375056a978fa717cae469cb0f8870b6a87d3aae6,androidtagview/src/main/java/co/lujun/androidtagview/TagView.java,TagView,onDraw,#Canvas#,127

Before Change


        if (mTextDirection == View.TEXT_DIRECTION_RTL){
//            mAbstractText = BidiFormatter.getInstance(true).unicodeWrap(mAbstractText);
        }
        canvas.drawText(mAbstractText, getWidth() / 2 - fontW / 2,
                getHeight() / 2 + fontH / 2 - bdDistance, mPaint);
    }

    @Override

After Change


        // Set the distance between baseline and descent as 5.5px
        float bdDistance = 5.5f;

        if (mTextDirection == View.TEXT_DIRECTION_RTL){
            float tmpX = getWidth() / 2 + fontW / 2;
            for (char c : mAbstractText.toCharArray()) {
                String sc = String.valueOf(c);
                tmpX -= mPaint.measureText(sc);
                canvas.drawText(sc, tmpX, getHeight() / 2 + fontH / 2 - bdDistance, mPaint);
            }
        }else {
            canvas.drawText(mAbstractText, getWidth() / 2 - fontW / 2,
                    getHeight() / 2 + fontH / 2 - bdDistance, mPaint);
        }
    }